<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>IgH EtherCAT Master: mailbox.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">IgH EtherCAT Master
   &#160;<span id="projectnumber">1.5.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mailbox_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">mailbox.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Mailbox functionality.  
<a href="#details">More...</a></p>

<p><a href="mailbox_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a189582ffd5ea94b41b00482c04968291"><td class="memItemLeft" align="right" valign="top"><a id="a189582ffd5ea94b41b00482c04968291"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mailbox_8h.html#a189582ffd5ea94b41b00482c04968291">EC_MBOX_HEADER_SIZE</a>&#160;&#160;&#160;6</td></tr>
<tr class="memdesc:a189582ffd5ea94b41b00482c04968291"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the mailbox header. <br /></td></tr>
<tr class="separator:a189582ffd5ea94b41b00482c04968291"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ab3a5be80064e09c9e7194d155c62cae8"><td class="memItemLeft" align="right" valign="top">uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mailbox_8h.html#ab3a5be80064e09c9e7194d155c62cae8">ec_slave_mbox_prepare_send</a> (const <a class="el" href="globals_8h.html#a8d9ffff7dbe1babaa4786a63f2860d57">ec_slave_t</a> *, <a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *, uint8_t, size_t)</td></tr>
<tr class="memdesc:ab3a5be80064e09c9e7194d155c62cae8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prepares a mailbox-send datagram.  <a href="#ab3a5be80064e09c9e7194d155c62cae8">More...</a><br /></td></tr>
<tr class="separator:ab3a5be80064e09c9e7194d155c62cae8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c9f8f70db11c581795e7520c10bb623"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mailbox_8h.html#a9c9f8f70db11c581795e7520c10bb623">ec_slave_mbox_prepare_check</a> (const <a class="el" href="globals_8h.html#a8d9ffff7dbe1babaa4786a63f2860d57">ec_slave_t</a> *, <a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *)</td></tr>
<tr class="memdesc:a9c9f8f70db11c581795e7520c10bb623"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prepares a datagram for checking the mailbox state.  <a href="#a9c9f8f70db11c581795e7520c10bb623">More...</a><br /></td></tr>
<tr class="separator:a9c9f8f70db11c581795e7520c10bb623"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d932f3a3716b07460950cf795e89891"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mailbox_8h.html#a4d932f3a3716b07460950cf795e89891">ec_slave_mbox_check</a> (const <a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *)</td></tr>
<tr class="memdesc:a4d932f3a3716b07460950cf795e89891"><td class="mdescLeft">&#160;</td><td class="mdescRight">Processes a mailbox state checking datagram.  <a href="#a4d932f3a3716b07460950cf795e89891">More...</a><br /></td></tr>
<tr class="separator:a4d932f3a3716b07460950cf795e89891"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c8ab58f4b9c8d78153e5d0403bae40b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mailbox_8h.html#a6c8ab58f4b9c8d78153e5d0403bae40b">ec_slave_mbox_prepare_fetch</a> (const <a class="el" href="globals_8h.html#a8d9ffff7dbe1babaa4786a63f2860d57">ec_slave_t</a> *, <a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *)</td></tr>
<tr class="memdesc:a6c8ab58f4b9c8d78153e5d0403bae40b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prepares a datagram to fetch mailbox data.  <a href="#a6c8ab58f4b9c8d78153e5d0403bae40b">More...</a><br /></td></tr>
<tr class="separator:a6c8ab58f4b9c8d78153e5d0403bae40b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9845c6e71e538cdaf2af6000b16f60c9"><td class="memItemLeft" align="right" valign="top">uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mailbox_8h.html#a9845c6e71e538cdaf2af6000b16f60c9">ec_slave_mbox_fetch</a> (const <a class="el" href="globals_8h.html#a8d9ffff7dbe1babaa4786a63f2860d57">ec_slave_t</a> *, const <a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *, uint8_t *, size_t *)</td></tr>
<tr class="memdesc:a9845c6e71e538cdaf2af6000b16f60c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Processes received mailbox data.  <a href="#a9845c6e71e538cdaf2af6000b16f60c9">More...</a><br /></td></tr>
<tr class="separator:a9845c6e71e538cdaf2af6000b16f60c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Mailbox functionality. </p>

<p class="definition">Definition in file <a class="el" href="mailbox_8h_source.html">mailbox.h</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ab3a5be80064e09c9e7194d155c62cae8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3a5be80064e09c9e7194d155c62cae8">&#9670;&nbsp;</a></span>ec_slave_mbox_prepare_send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t* ec_slave_mbox_prepare_send </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="globals_8h.html#a8d9ffff7dbe1babaa4786a63f2860d57">ec_slave_t</a> *&#160;</td>
          <td class="paramname"><em>slave</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *&#160;</td>
          <td class="paramname"><em>datagram</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prepares a mailbox-send datagram. </p>
<dl class="section return"><dt>Returns</dt><dd>Pointer to mailbox datagram data, or ERR_PTR() code. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">slave</td><td>slave </td></tr>
    <tr><td class="paramname">datagram</td><td>datagram </td></tr>
    <tr><td class="paramname">type</td><td>mailbox protocol </td></tr>
    <tr><td class="paramname">size</td><td>size of the data </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="mailbox_8c_source.html#l00051">51</a> of file <a class="el" href="mailbox_8c_source.html">mailbox.c</a>.</p>

</div>
</div>
<a id="a9c9f8f70db11c581795e7520c10bb623"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c9f8f70db11c581795e7520c10bb623">&#9670;&nbsp;</a></span>ec_slave_mbox_prepare_check()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ec_slave_mbox_prepare_check </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="globals_8h.html#a8d9ffff7dbe1babaa4786a63f2860d57">ec_slave_t</a> *&#160;</td>
          <td class="paramname"><em>slave</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *&#160;</td>
          <td class="paramname"><em>datagram</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prepares a datagram for checking the mailbox state. </p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000030">Todo:</a></b></dt><dd>Determine sync manager used for receive mailbox </dd></dl>
<dl class="section return"><dt>Returns</dt><dd>0 in case of success, else &lt; 0 </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">slave</td><td>slave </td></tr>
    <tr><td class="paramname">datagram</td><td>datagram </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="mailbox_8c_source.html#l00096">96</a> of file <a class="el" href="mailbox_8c_source.html">mailbox.c</a>.</p>

</div>
</div>
<a id="a4d932f3a3716b07460950cf795e89891"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4d932f3a3716b07460950cf795e89891">&#9670;&nbsp;</a></span>ec_slave_mbox_check()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ec_slave_mbox_check </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *&#160;</td>
          <td class="paramname"><em>datagram</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Processes a mailbox state checking datagram. </p>
<dl class="section return"><dt>Returns</dt><dd>0 in case of success, else &lt; 0 </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">datagram</td><td>datagram </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="mailbox_8c_source.html#l00115">115</a> of file <a class="el" href="mailbox_8c_source.html">mailbox.c</a>.</p>

</div>
</div>
<a id="a6c8ab58f4b9c8d78153e5d0403bae40b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6c8ab58f4b9c8d78153e5d0403bae40b">&#9670;&nbsp;</a></span>ec_slave_mbox_prepare_fetch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ec_slave_mbox_prepare_fetch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="globals_8h.html#a8d9ffff7dbe1babaa4786a63f2860d57">ec_slave_t</a> *&#160;</td>
          <td class="paramname"><em>slave</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *&#160;</td>
          <td class="paramname"><em>datagram</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prepares a datagram to fetch mailbox data. </p>
<dl class="section return"><dt>Returns</dt><dd>0 in case of success, else &lt; 0 </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">slave</td><td>slave </td></tr>
    <tr><td class="paramname">datagram</td><td>datagram </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="mailbox_8c_source.html#l00127">127</a> of file <a class="el" href="mailbox_8c_source.html">mailbox.c</a>.</p>

</div>
</div>
<a id="a9845c6e71e538cdaf2af6000b16f60c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9845c6e71e538cdaf2af6000b16f60c9">&#9670;&nbsp;</a></span>ec_slave_mbox_fetch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t* ec_slave_mbox_fetch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="globals_8h.html#a8d9ffff7dbe1babaa4786a63f2860d57">ec_slave_t</a> *&#160;</td>
          <td class="paramname"><em>slave</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structec__datagram__t.html">ec_datagram_t</a> *&#160;</td>
          <td class="paramname"><em>datagram</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Processes received mailbox data. </p>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the received data, or ERR_PTR() code. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">slave</td><td>slave </td></tr>
    <tr><td class="paramname">datagram</td><td>datagram </td></tr>
    <tr><td class="paramname">type</td><td>expected mailbox protocol </td></tr>
    <tr><td class="paramname">size</td><td>size of the received data </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="mailbox_8c_source.html#l00165">165</a> of file <a class="el" href="mailbox_8c_source.html">mailbox.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_c1346cf4828efdd0d2baf0d391d01b77.html">master</a></li><li class="navelem"><a class="el" href="mailbox_8h.html">mailbox.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
